package com.novel.exception;

import com.novel.constants.ResultEnum;

/**
 * 参数异常类
 *
 * @author huawei
 */
public class ArgumentException extends RuntimeException {
    /**
     * 业务异常code
     */
    private Integer code = 400;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public ArgumentException(String message) {
        super(message);
    }

    /**
     * 枚举构造方法
     *
     * @param message enum
     */
    public ArgumentException(ResultEnum message) {
        super(message.getMessage());
    }

    /**
     * 防止内存异常
     *
     * @return null
     */
    @Override
    public synchronized Throwable fillInStackTrace() {
        return null;
    }
}